<script>
import { cloneDeep, divide } from "lodash-es";

export default {
  props: {
    schema: {
      type: Object,
      default: null,
    },
  },
  components: {  },

  render() {
    const Element = this.schema.tag;
    let Comp = <Element schema={this.schema} > </Element>;

    if (this.schema.formItem) {
      Comp = (
        <el-form-item
          label={this.schema.label}
          prop={this.schema.name}
        >
          {Comp}
        </el-form-item>
      );
    }

    return Comp;
  },
};
</script>

<style lang="scss" scoped>
.drag-tool {
  word-wrap: break-word;
  box-sizing: border-box;
  min-height: 20px;
  outline: 1px dashed #2e73ff;
  overflow: hidden;
  padding: 2px;
  position: relative;
  word-break: break-all;
}
.drag-tool.active {
  outline: 2px solid #2e73ff;
}
.drag-mask {
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 1900;
}
.drag-l,
.drag-r {
  position: absolute;
  z-index: 1904;
}

.drag-l {
  left: 0;
  top: 0;
}

.drag-r {
  bottom: 2px;
  right: 2px;
}

.drag-btn {
  background-color: #2e73ff;
  color: #fff;
  cursor: pointer;
  float: left;
  height: 18px;
  justify-content: center;
  line-height: 20px;
  padding-bottom: 1px;
  text-align: center;
  width: 18px;
}

.action-group {
  position: absolute;
  top: 0;
  right: 20px;
  z-index: 10;
  cursor: pointer;
  line-height: 17px;
}

.drag-tool .drag-tool {
  margin: 5px;
}
::v-deep .el-form-item {
  margin-top: 22px;
  margin-bottom: 0px;
}
</style>
